package com.bingqing.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.bingqing.common.Result;
import com.bingqing.entity.Log;
import com.bingqing.entity.Params;
import com.bingqing.entity.Type;
import com.bingqing.exception.CustomException;
import com.bingqing.service.LogService;
import com.bingqing.service.TypeService;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ClassName: TypeController
 * Package: com.bingqing.controller
 * Description:
 *
 * @Author liuyujie
 * @Create 2024-03-10 9:24
 * @Version 1.0
 */
@RestController
@RequestMapping("/log")
public class LogController {
    @Resource
    LogService logService;

    //分页查询
    @GetMapping("/search")
    public Result findBySearch(Params params) {
        PageInfo<Log> info = logService.findBySearch(params);
        return Result.success(info);
    }

    //删除
    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Integer id) {
        logService.deleteById(id);
        return Result.success();
    }


}
